package com.ruoyi.module.websiteMember.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.module.websiteMember.domain.WebsiteMember;
import com.ruoyi.module.websiteMember.mapper.WebsiteMemberMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.module.websiteMember.service.IWebsiteMemberService;

/**
 * 微官网Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-01-26
 */
@Service
public class WebsiteMemberServiceImpl implements IWebsiteMemberService 
{
    @Autowired
    private WebsiteMemberMapper websiteMemberMapper;

    /**
     * 查询微官网
     * 
     * @param websiteId 微官网主键
     * @return 微官网
     */
    @Override
    public WebsiteMember selectWebsiteMemberByWebsiteId(Long websiteId)
    {
        return websiteMemberMapper.selectWebsiteMemberByWebsiteId(websiteId);
    }

    /**
     * 查询微官网列表
     * 
     * @param websiteMember 微官网
     * @return 微官网
     */
    @Override
    public List<WebsiteMember> selectWebsiteMemberList(WebsiteMember websiteMember)
    {
        websiteMember.setCreateId(SecurityUtils.getUserId());
        return websiteMemberMapper.selectWebsiteMemberList(websiteMember);
    }

    /**
     * 新增微官网
     * 
     * @param websiteMember 微官网
     * @return 结果
     */
    @Override
    public int insertWebsiteMember(WebsiteMember websiteMember)
    {
        websiteMember.setCreateTime(DateUtils.getNowDate());
        websiteMember.setCreateId(SecurityUtils.getUserId());
        return websiteMemberMapper.insertWebsiteMember(websiteMember);
    }

    /**
     * 修改微官网
     * 
     * @param websiteMember 微官网
     * @return 结果
     */
    @Override
    public int updateWebsiteMember(WebsiteMember websiteMember)
    {
        websiteMember.setUpdateTime(DateUtils.getNowDate());
        websiteMember.setUpdateId(SecurityUtils.getUserId());
        return websiteMemberMapper.updateWebsiteMember(websiteMember);
    }

    /**
     * 批量删除微官网
     * 
     * @param websiteIds 需要删除的微官网主键
     * @return 结果
     */
    @Override
    public int deleteWebsiteMemberByWebsiteIds(Long[] websiteIds)
    {
        return websiteMemberMapper.deleteWebsiteMemberByWebsiteIds(websiteIds);
    }

    /**
     * 删除微官网信息
     * 
     * @param websiteId 微官网主键
     * @return 结果
     */
    @Override
    public int deleteWebsiteMemberByWebsiteId(Long websiteId)
    {
        return websiteMemberMapper.deleteWebsiteMemberByWebsiteId(websiteId);
    }
}
